import { _decorator, Vec3, Node, Component, Contact2DType, Collider2D, randomRange, tween } from 'cc';
import { EGroup, EnemyManager } from '../EnemyManager';

const { ccclass } = _decorator;


// 向前飞行的飞刀
@ccclass('Knife')
export class Knife extends Component {

    direction: Vec3 = new Vec3(1, 0, 0); // 飞刀的初始方向



    speed: number = 10; // 刀的移动速度

    update(dt){
        // 更新飞刀位置
        this.node.setPosition(this.node.position.add(this.direction.multiplyScalar(this.speed * globalThis.dt))); // 使用全局dt来控制速度

    }






}